﻿using AbpPcClient.WpfClient.Service.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AbpPcClient.WpfClient.Service.Login
{
    public class LoginService:BaseServer
    {
        public ResultModel Login(string username, string password)
        {
           
            string url = HttpAbpApiRequestTools.apiHost + "api/TokenAuth/Authenticate";
            LoginDto dto = new LoginDto()
            {
                UserNameOrEmailAddress = username,
                Password = password,
                RememberClient = true
            };
            ResultModel result = HttpAbpApiRequestTools.Post(url, dto);
            if (result != null && result.Success)
            {
                HttpAbpApiRequestTools.token = result.Result.accessToken;
            }
            return result;
        }

    }
}

